package Demo2;

import java.util.Scanner;

public class Main9 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int len = in.nextInt();
        int x = in.nextInt();
        int[] nums = new int[len];
        for(int i = 0; i < len; i++) {
            nums[i] = in.nextInt();
        }
        int left = 0, sum = 0, count = Integer.MAX_VALUE;
        int l1 = 0, r1 = 0;
        for(int i = 0; i < len; i++) {
            sum += nums[i];
            while(left <= i && sum > x) {
                if(i - left  < count) {
                    count = i - left + 1;
                    l1 = left;
                    r1 = i;
                }
                sum -= nums[left];
                left++;
            }
        }
        System.out.print(l1 + " " + r1);
    }
}